package park;

import java.util.ArrayList;

public class J24ProfessorServiceImpl implements J24ProfessorService {
	
	private J24ProfessorDAO pdao;
	
	public J24ProfessorServiceImpl(){ //J24ProfessorDAOImpl 로 되어있다가 J24ProfessorServiceImpl로 바꿈
		
		pdao = new J24ProfessorDAOImpl();
		
	}

	@Override
	public void newProfessor() {
		J24ProfessorVO pvo = new J24ProfessorVO();
		// 여기서 syso을 씌워준다 pdao.insertProfessor(pvo);
		System.out.println(pdao.insertProfessor(pvo));
	}

	@Override
	public void readProfessor() { //입력받아서 pdao.selectProfessor(); 호출
		ArrayList<J24ProfessorVO> pvoes = new ArrayList<>(); //arraylist 추가
		pvoes = pdao.selectProfessor();//read는 syso 안함
		//pdao.selectProfessor(); 
		
		
		for(J24ProfessorVO p : pvoes){
			System.out.println(p);
		}
		
		
	}

	@Override
	public void readOneProfessor() { 
		String pfno = "";
		ArrayList<J24ProfessorVO> pvoes = new ArrayList<>();
		pvoes = pdao.selectOneProfessor(pfno);
		//String pfno = "";
		//pdao.selectOneProfessor(pfno); //read는 syso 안함
	}

	@Override
	public void modifyProfessor() {
		String pfno = "";
		System.out.println(pdao.updateProfessor(pfno));
	}

	@Override
	public void removeProfessor() {
		String pfno = "";
		System.out.println(pdao.deleteProfessor(pfno));
	}

}
